/**
* Copyright (C) 2018-2020
* All rights reserved, Designed By www.yixiang.co
* 注意：
* 本软件为www.yixiang.co开发研制，未经购买不得使用
* 购买后可获得全部源代码（禁止转卖、分享、上传到码云、github等开源平台）
* 一经发现盗用、分享等行为，将追究法律责任，后果自负
*/
package co.yixiang.modules.hotTopicComment.service.mapper;

import co.yixiang.common.mapper.CoreMapper;
import co.yixiang.modules.hotTopicComment.domain.YxComment;
import co.yixiang.modules.hotTopicComment.service.dto.YxCommentPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

/**
* @author hupeng
* @date 2021-08-12
*/
@Repository
public interface YxCommentMapper extends CoreMapper<YxComment> {

    @Select("<script> select yc.*,yu.nickname,yu.avatar from yx_comment yc LEFT JOIN yx_user yu on yu.uid = yc.uid where yc.hot_topic_id = #{hotTopicId} order by yc.create_time desc </script> ")
    Page<YxCommentPage> getHotTopicCommentPage(@Param("page") Page page1, Integer hotTopicId);

}
